<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎使用TTU</title>
<style type="text/css">
<!--
#account_title {
	height: auto;
	width: auto;
	margin-top: 12px;
	margin-left: 20px;
	font-weight: 800;
	font-size: 18px;
}
#search_result {
	float: left;
	height: 720px;
	width: 550px;
	margin-top: 10px;
}
-->
</style>
<link href="css/home.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
include_once 'msg_redirect.php'; 
if($_COOKIE['TTU'] != "logined"){
	msg_redirect("您还未登录哦！", "index.php");
}?>
<div id="container">
<div id="header">
	<div id="logo"><img src="image/logo2.jpg" width="220" height="30" /></div>
	<div id="nav_area">
	  <a  class="not_current_nav" href="home.php">我的首页</a>
      <a  class="not_current_nav" href="my_account">我的账号</a>
      <a  class="not_current_nav" href="logout.php">退出</a>
      <a  class="not_current_nav" href="search_people.php">找人</a>
      <form action="weibo_search_result.php" method="post" name="find_form">
        <input id="find"name="keyword" type="text" value="搜微博" />
        <input id="search_button"name="search_submit" type="image" src="image/search.jpg" />
        <input name="search" type="hidden" value="search"/>
      </form>
  </div>
</div>
    
<div id="left">
<ul id="nav3">
  <li ><a class="current_page">搜索结果</a></li>
  </ul><hr class="line"/>
</div>
  <div id="primary">
    <div id="account_title">搜索结果如下</div>
    <div id="search_result">
    <?php 
    /*循环输出weibo表的内容，同时输出头像，昵称，发布微博的时间*/
    include_once 'sql_connect.php'; 
    include_once 'msg_redirect.php';
    if($_POST[search] == "search"){
    	$keyword = $_POST[keyword];
		 $search_sql = mysql_query("select weibo.u_no,w_content,w_date,u_name,h_id from weibo,user_info 
									where w_content like '%$keyword%' ORDER BY w_id DESC",$connection);
		$search_result = mysql_fetch_array($search_sql);
		if ($search_result){
    do{
    ?>
    <div id="blog">
      <div class="small_photo"><img src="<?php 
							/*用以输出用户端的头像*/
							include_once 'sql_connect.php'; 
    						include_once 'msg_redirect.php';
    						$u_no = $search_result[u_no];
    						$show_head_sql = mysql_query("select h_data from head where u_no='$u_no'",$connection);
    						$show_head_result = mysql_fetch_array($show_head_sql);
    						$my_data = $show_head_result[h_data];
    						if (!$my_data){
    							echo "head_image/szu.jpg";
    						}
    						else echo "$my_data";
    						?>" width="60" height="60" /></div>
	    <div class="blog_words">
	    <?php 
	    echo $search_result[u_name].": ".$search_result[w_content];
	    ?>
	    </div>
    <div class="time"><?php echo $search_result[w_date];?></div>
      <div class="todo"><ul><li><a href="#">评论</a></li><li id="nav2_weibo"><a href="#">转发</a></li></ul></div>
   	  <hr class="line2"/>
    </div>
    <?php 
    }while ($search_result=mysql_fetch_array($search_sql));}
		else echo"<div id='blog'>对不起，您要搜索的内容不存在！</div>";}?>
  </div>
  </div>
</div>
<div id="right">
	<div class="right_title">
    <h4>你可能认识的人</h4></div>
		<ul id="people_mayknow">
	  	  <li><div class="small_photo"></div><div class="people_info"></div></li>
		  <li><div class="small_photo"></div><div class="people_info"></div></li>
			<li><div class="small_photo"></div><div class="people_info"></div></li>
	</ul>
	<div class="more"><a href="#">更多&gt;&gt;</a></div>
	<hr class="line3"/>
	<div class="right_title"><h4>社团活动</h4></div>
<ul class="group_activity">
        	<li><a href="#">吉他社嘉年华11月10号学生活动中心与你有约</a></li>
            <li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
  </ul>
    <div class="more"><a href="#">更多&gt;&gt;</a></div>    
    <hr class="line3" />
    <div class="right_title"><h4>公文通</h4></div>
    	<ul class="group_activity">
        	<li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
            <li><a href="#">..........</a></li>
    	</ul>
    <div class="more"><a href="#">更多&gt;&gt;</a></div>    
    <hr class="line3" />
</div>
  <div id="footer">深圳大学计算机系IBM项目网站&nbsp;版权所有<br />
  mobile: 633721&nbsp;&nbsp;E-mail: chen_zx_happy@163.com</div></div>
</body>
</html>